import {mdPlugin} from './config/plugins';

const nav = [
  {text: '安装指南', link: '/components/'},
  {text: '基础组件', link: '/components/button/'},
  {text: 'Gitee码云地址', link: 'https://gitee.com/thisfourier/temp-ui'},
  {
    text: '博客',
    items: [
      {text: '个人博客', link: 'http://docs.webstart.top/'},
      {text: 'CSDN', link: 'https://blog.csdn.net/weixin_44688451'}
    ]
  }
];

const sidebar = {
  '/': [
    {
      text: '通用',
      items: [
        {text: 'Button 按钮', link: '/components/button/'},
        {text: 'Tag 标签', link: '/components/tag/'}
      ]
    },
    {text: '导航'},
    {text: '反馈'},
    {text: '数据录入'},
    {text: '数据展示'},
    {text: '布局'}
  ]
};

const isProd = process.env.NODE_ENV === 'production';
export default {
  themeConfig: {sidebar, nav},
  head: [['script', {type: 'text/javascript', src: `${isProd ? '/docs' : ''}/js/message.js`}]],
  base: '/docs',
  markdown: {
    config(md: any) {
      mdPlugin(md);
    }
  }
};
